home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2975 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.uregina.ca!usenet
  2. From: Mike Hebert <hebert@cs.uregina.ca>
  3. Newsgroups: comp.lang.c
  4. Subject: Help with Structures
  5. Date: 25 Jan 1996 06:08:03 GMT
  6. Organization: University of Regina
  7. Message-ID: <4e76o3$iai@sue.cc.uregina.ca>
  8. NNTP-Posting-Host: hercules.cs.uregina.ca
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  13.  
  14. (Please respond via e-mail)
  15.  
  16. First, let me give you a bit of a backgroud.  I programmed with QuickBasic 
  17. v4.5 (interfaced with assembly laguage) on and off for about 3 years.  A 
  18. few months ago, I thought it was time to move on to C (Watcom C v10.5 to 
  19. be exact).
  20.  
  21. I am now at the point where I am trying to convert my 16-bit QB-compatible 
  22. assembly code into 32-bit Watcom C-compatible assembly code, and I've run 
  23. into a minor problem.
  24.  
  25. The specific procedure that I am trying to convert simply passes a pointer 
  26. to a bitmap, a pointer to a screen buffer, and X and Y co-ordinates.  The 
  27. procedure simply copies everything ASAP.
  28.  
  29. My problem is this:  I want the first two dwords (long ints) in the bitmap 
  30. array to be the width and height of the bitmap (respectively); how do I 
  31. reference those first two elements as dwords (long ints) and refer to the 
  32. rest of the array as bytes (chars)?
  33.  
  34. I don't want to pass the width and height as seperate parameters because 
  35. that would mean having to use the stack which would mess things up...
  36.  
  37. If I use a struct, how do I reference it in the assembly procedure?  For 
  38. that matter, how do I set up the prototype so that I can use any structure 
  39. using that definition?
  40.  
  41. (PS:  The reason I want to use dwords for the width and height in my 
  42. algorithm is that it makes everything on the assembly side a little 
  43. easier.)
  44.  
  45.  
  46. --------------------------------------------------------------------
  47. Michael Hebert                         E-mail: hebert@cs.uregina.ca
  48.                          Web page: http://www.cs.uregina.ca/~hebert
  49. --------------------------------------------------------------------
  50.  
  51.  
  52.